Skip to content

[Bug]: Docx to pdf not working #3534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
Mstfcyberyksl opened this issue May 17, 2025 · 5 comments
Open
1 task done

[Bug]: Docx to pdf not working #3534

Mstfcyberyksl opened this issue May 17, 2025 · 5 comments

Comments

@Mstfcyberyksl
Copy link

Installation Method

None

The Problem

I couldn't convert a docx file to pdf

Version of Stirling-PDF

0.26.1

Last Working Version of Stirling-PDF

No response

Page Where the Problem Occurred

http://localhost:8080/file-to-pdf

Docker Configuration

Relevant Log Output

Internal Server Error:java.io.IOException: Cannot run program "unoconv": error=2, No such file or directory
java.io.IOException: Cannot run program "unoconv": error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
	at stirling.software.SPDF.utils.ProcessExecutor.runCommandWithOutputHandling(ProcessExecutor.java:102)
	at stirling.software.SPDF.utils.ProcessExecutor.runCommandWithOutputHandling(ProcessExecutor.java:85)
	at stirling.software.SPDF.controller.api.converters.ConvertOfficeController.convertToPdf(ConvertOfficeController.java:62)
	at stirling.software.SPDF.controller.api.converters.ConvertOfficeController.processFileToPDF(ConvertOfficeController.java:90)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:255)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:188)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:925)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:830)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:914)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)

Additional Information

Sayısal AnalizProje2025_REV1.docx

here is the file that i tried to convert

Distributor ID: Ubuntu
Description: Ubuntu 24.04.2 LTS
Release: 24.04
Codename: noble

i use zen browser

Browsers Affected

Other

No Duplicate of the Issue

  • I have verified that there are no existing issues raised related to my problem.
Copy link

dosubot bot commented May 17, 2025

Hello @Mstfcyberyksl! I'm Dosu, and I'm here to help you with any bugs, questions, or contributions you might have while you wait for a human maintainer. Let's tackle this together!

To resolve the "Internal Server Error: java.io.IOException: Cannot run program 'unoconv': error=2, No such file or directory" when using Stirling-PDF, you need to ensure that the unoconv program is installed on your system. The error indicates that the system cannot find the unoconv executable.

You can install unoconv on Ubuntu by running the following command:

sudo apt-get install unoconv

After installing unoconv, ensure that it is accessible in your system's PATH. You can verify the installation by running:

which unoconv

This should return the path to the unoconv executable. If it does, restart the Stirling-PDF service and try the conversion again.

Additionally, according to the Stirling-PDF documentation, you may need to start unoserver alongside Stirling-PDF to handle document conversions. You can do this by running:

unoserver --port 2003 --interface 0.0.0.0

Consider adding this command to your startup script or systemd service file to ensure it starts automatically with Stirling-PDF. This setup can help manage document conversions more effectively.

Furthermore, if you are using the non-docker version of Stirling-PDF, ensure that LibreOffice is also installed, as it is required for the conversion operations. The service uses both LibreOffice and Unoconv to convert documents to PDF [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added the Back End Issues related to back-end development label May 17, 2025
@Ludy87
Copy link
Contributor

Ludy87 commented May 18, 2025

Hi @Mstfcyberyksl

Please use the latest version, 0.26.1, from Jun 15, 2024. You can find the latest version here: https://github.com/Stirling-Tools/Stirling-PDF/releases

@Ludy87 Ludy87 removed the Back End Issues related to back-end development label May 18, 2025
@Mstfcyberyksl
Copy link
Author

Hi @Mstfcyberyksl

Please use the latest version, 0.26.1, from Jun 15, 2024. You can find the latest version here: https://github.com/Stirling-Tools/Stirling-PDF/releases

i couldn't see the "file to pdf" option there.

@Ludy87
Copy link
Contributor

Ludy87 commented May 18, 2025

Then it may be that you are missing the program: unoconv

@Mstfcyberyksl
Copy link
Author

Then it may be that you are missing the program: unoconv

i tried after installing the unoconv but it is still missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants